<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        // promise.then 是对上一个promise的处理
        new Promise((resolve, reject) => {
            resolve('成功状态')
            
        }).then(value => {
            return 'asd'
        }, reason => {
            console.log(reason)
        }).then(value => {
            console.log(value)  // asd
        })

        console.log('=======')

        new Promise((resolve, reject) => {
            resolve('成功状态')
            
        }).then(value => {
            return new Promise((resolve, reject) => {
                resolve('789')
            })
        }, reason => {
            console.log(reason)
        }).then(value => {
            console.log(value)  // 789
        })        
      
    </script>
</body>

</html>